Left Termination of the query pattern zebra_in_7(a, a, a, a, a, a, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

zebra(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) :- ','(eq(Englishman, Red), ','(eq(Spaniard, Dog), ','(eq(Green, Coffee), ','(eq(Ukrainian, Tea), ','(to_the_right(Green, Ivory), ','(eq(Winston, Snails), ','(eq(Kool, Yellow), ','(eq(Milk, third), ','(eq(Norwegian, first), ','(next_to(Fox, Chesterfield), ','(next_to(Horse, Kool), ','(eq(Lucky, Juice), ','(eq(Japanese, Parliament), ','(next_to(Norwegian, Blue), ','(houses(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))), ','(houses(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))), ','(houses(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))), ','(houses(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))), houses(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))))))))))))))))))).
houses(Prop) :- domain(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))).
domain([], X).
domain(.(X, Rest), Domain) :- ','(select(X, Domain, NewDomain), domain(Rest, NewDomain)).
select(X, .(X, R), R).
select(X, .(Y, R), .(Y, Rest)) :- select(X, R, Rest).
next_to(fifth, fourth).
next_to(fourth, fifth).
next_to(fourth, third).
next_to(third, fourth).
next_to(third, second).
next_to(second, third).
next_to(second, first).
next_to(first, second).
to_the_right(fifth, fourth).
to_the_right(fourth, third).
to_the_right(third, second).
to_the_right(second, first).
eq(X, X).

Queries:

zebra(a,a,a,a,a,a,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

zebra_in(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
eq_in(X, X) → eq_out(X, X)
U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
to_the_right_in(second, first) → to_the_right_out(second, first)
to_the_right_in(third, second) → to_the_right_out(third, second)
to_the_right_in(fourth, third) → to_the_right_out(fourth, third)
to_the_right_in(fifth, fourth) → to_the_right_out(fifth, fourth)
U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
next_to_in(first, second) → next_to_out(first, second)
next_to_in(second, first) → next_to_out(second, first)
next_to_in(second, third) → next_to_out(second, third)
next_to_in(third, second) → next_to_out(third, second)
next_to_in(third, fourth) → next_to_out(third, fourth)
next_to_in(fourth, third) → next_to_out(fourth, third)
next_to_in(fourth, fifth) → next_to_out(fourth, fifth)
next_to_in(fifth, fourth) → next_to_out(fifth, fourth)
U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
houses_in(Prop) → U20(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
domain_in(.(X, Rest), Domain) → U21(X, Rest, Domain, select_in(X, Domain, NewDomain))
select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))
U21(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U22(X, Rest, Domain, domain_in(Rest, NewDomain))
domain_in([], X) → domain_out([], X)
U22(X, Rest, Domain, domain_out(Rest, NewDomain)) → domain_out(.(X, Rest), Domain)
U20(Prop, domain_out(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))) → houses_out(Prop)
U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_out(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))) → zebra_out(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water)

The argument filtering Pi contains the following mapping:
zebra_in(x1, x2, x3, x4, x5, x6, x7)  =  zebra_in
U1(x1, x2, x3, x4, x5, x6, x7, x8)  =  U1(x8)
eq_in(x1, x2)  =  eq_in
eq_out(x1, x2)  =  eq_out
U2(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U2(x9)
U3(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U3(x10)
U4(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U4(x12)
U5(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U5(x13)
to_the_right_in(x1, x2)  =  to_the_right_in
second  =  second
first  =  first
to_the_right_out(x1, x2)  =  to_the_right_out(x1, x2)
third  =  third
fourth  =  fourth
fifth  =  fifth
U6(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U6(x14)
U7(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U7(x16)
U8(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U8(x18)
U9(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U9(x19)
U10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U10(x19)
next_to_in(x1, x2)  =  next_to_in
next_to_out(x1, x2)  =  next_to_out(x1, x2)
U11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U11(x21)
U12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U12(x22)
U13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U13(x24)
U14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U14(x25)
U15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U15(x5, x21)
houses_in(x1)  =  houses_in(x1)
.(x1, x2)  =  .(x2)
[]  =  []
U20(x1, x2)  =  U20(x2)
domain_in(x1, x2)  =  domain_in(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
U22(x1, x2, x3, x4)  =  U22(x4)
domain_out(x1, x2)  =  domain_out
houses_out(x1)  =  houses_out
U16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U16(x5, x21)
U17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U17(x5, x17)
U18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U18(x5, x12)
U19(x1, x2, x3, x4, x5, x6, x7, x8)  =  U19(x5, x8)
zebra_out(x1, x2, x3, x4, x5, x6, x7)  =  zebra_out(x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

zebra_in(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
eq_in(X, X) → eq_out(X, X)
U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
to_the_right_in(second, first) → to_the_right_out(second, first)
to_the_right_in(third, second) → to_the_right_out(third, second)
to_the_right_in(fourth, third) → to_the_right_out(fourth, third)
to_the_right_in(fifth, fourth) → to_the_right_out(fifth, fourth)
U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
next_to_in(first, second) → next_to_out(first, second)
next_to_in(second, first) → next_to_out(second, first)
next_to_in(second, third) → next_to_out(second, third)
next_to_in(third, second) → next_to_out(third, second)
next_to_in(third, fourth) → next_to_out(third, fourth)
next_to_in(fourth, third) → next_to_out(fourth, third)
next_to_in(fourth, fifth) → next_to_out(fourth, fifth)
next_to_in(fifth, fourth) → next_to_out(fifth, fourth)
U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
houses_in(Prop) → U20(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
domain_in(.(X, Rest), Domain) → U21(X, Rest, Domain, select_in(X, Domain, NewDomain))
select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))
U21(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U22(X, Rest, Domain, domain_in(Rest, NewDomain))
domain_in([], X) → domain_out([], X)
U22(X, Rest, Domain, domain_out(Rest, NewDomain)) → domain_out(.(X, Rest), Domain)
U20(Prop, domain_out(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))) → houses_out(Prop)
U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_out(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))) → zebra_out(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water)

The argument filtering Pi contains the following mapping:
zebra_in(x1, x2, x3, x4, x5, x6, x7)  =  zebra_in
U1(x1, x2, x3, x4, x5, x6, x7, x8)  =  U1(x8)
eq_in(x1, x2)  =  eq_in
eq_out(x1, x2)  =  eq_out
U2(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U2(x9)
U3(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U3(x10)
U4(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U4(x12)
U5(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U5(x13)
to_the_right_in(x1, x2)  =  to_the_right_in
second  =  second
first  =  first
to_the_right_out(x1, x2)  =  to_the_right_out(x1, x2)
third  =  third
fourth  =  fourth
fifth  =  fifth
U6(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U6(x14)
U7(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U7(x16)
U8(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U8(x18)
U9(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U9(x19)
U10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U10(x19)
next_to_in(x1, x2)  =  next_to_in
next_to_out(x1, x2)  =  next_to_out(x1, x2)
U11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U11(x21)
U12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U12(x22)
U13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U13(x24)
U14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U14(x25)
U15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U15(x5, x21)
houses_in(x1)  =  houses_in(x1)
.(x1, x2)  =  .(x2)
[]  =  []
U20(x1, x2)  =  U20(x2)
domain_in(x1, x2)  =  domain_in(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
U22(x1, x2, x3, x4)  =  U22(x4)
domain_out(x1, x2)  =  domain_out
houses_out(x1)  =  houses_out
U16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U16(x5, x21)
U17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U17(x5, x17)
U18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U18(x5, x12)
U19(x1, x2, x3, x4, x5, x6, x7, x8)  =  U19(x5, x8)
zebra_out(x1, x2, x3, x4, x5, x6, x7)  =  zebra_out(x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

ZEBRA_IN(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
ZEBRA_IN(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → EQ_IN(Englishman, Red)
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U21(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → EQ_IN(Spaniard, Dog)
U21(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U31(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U21(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → EQ_IN(Green, Coffee)
U31(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U41(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U31(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → EQ_IN(Ukrainian, Tea)
U41(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U51(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
U41(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → TO_THE_RIGHT_IN(Green, Ivory)
U51(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U61(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U51(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → EQ_IN(Winston, Snails)
U61(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U71(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U61(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → EQ_IN(Kool, Yellow)
U71(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U81(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U71(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → EQ_IN(Milk, third)
U81(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U91(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U81(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → EQ_IN(Norwegian, first)
U91(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U101(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
U91(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → NEXT_TO_IN(Fox, Chesterfield)
U101(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U111(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U101(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → NEXT_TO_IN(Horse, Kool)
U111(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U121(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U111(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → EQ_IN(Lucky, Juice)
U121(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U131(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U121(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → EQ_IN(Japanese, Parliament)
U131(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U141(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U131(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → NEXT_TO_IN(Norwegian, Blue)
U141(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U151(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
U141(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → HOUSES_IN(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))
HOUSES_IN(Prop) → U201(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
HOUSES_IN(Prop) → DOMAIN_IN(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))
DOMAIN_IN(.(X, Rest), Domain) → U211(X, Rest, Domain, select_in(X, Domain, NewDomain))
DOMAIN_IN(.(X, Rest), Domain) → SELECT_IN(X, Domain, NewDomain)
SELECT_IN(X, .(Y, R), .(Y, Rest)) → U231(X, Y, R, Rest, select_in(X, R, Rest))
SELECT_IN(X, .(Y, R), .(Y, Rest)) → SELECT_IN(X, R, Rest)
U211(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U221(X, Rest, Domain, domain_in(Rest, NewDomain))
U211(X, Rest, Domain, select_out(X, Domain, NewDomain)) → DOMAIN_IN(Rest, NewDomain)
U151(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U161(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U151(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → HOUSES_IN(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))
U161(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U171(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U161(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → HOUSES_IN(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))
U171(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U181(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U171(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → HOUSES_IN(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))
U181(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U191(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U181(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → HOUSES_IN(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))

The TRS R consists of the following rules:

zebra_in(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
eq_in(X, X) → eq_out(X, X)
U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
to_the_right_in(second, first) → to_the_right_out(second, first)
to_the_right_in(third, second) → to_the_right_out(third, second)
to_the_right_in(fourth, third) → to_the_right_out(fourth, third)
to_the_right_in(fifth, fourth) → to_the_right_out(fifth, fourth)
U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
next_to_in(first, second) → next_to_out(first, second)
next_to_in(second, first) → next_to_out(second, first)
next_to_in(second, third) → next_to_out(second, third)
next_to_in(third, second) → next_to_out(third, second)
next_to_in(third, fourth) → next_to_out(third, fourth)
next_to_in(fourth, third) → next_to_out(fourth, third)
next_to_in(fourth, fifth) → next_to_out(fourth, fifth)
next_to_in(fifth, fourth) → next_to_out(fifth, fourth)
U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
houses_in(Prop) → U20(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
domain_in(.(X, Rest), Domain) → U21(X, Rest, Domain, select_in(X, Domain, NewDomain))
select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))
U21(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U22(X, Rest, Domain, domain_in(Rest, NewDomain))
domain_in([], X) → domain_out([], X)
U22(X, Rest, Domain, domain_out(Rest, NewDomain)) → domain_out(.(X, Rest), Domain)
U20(Prop, domain_out(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))) → houses_out(Prop)
U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_out(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))) → zebra_out(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water)

The argument filtering Pi contains the following mapping:
zebra_in(x1, x2, x3, x4, x5, x6, x7)  =  zebra_in
U1(x1, x2, x3, x4, x5, x6, x7, x8)  =  U1(x8)
eq_in(x1, x2)  =  eq_in
eq_out(x1, x2)  =  eq_out
U2(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U2(x9)
U3(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U3(x10)
U4(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U4(x12)
U5(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U5(x13)
to_the_right_in(x1, x2)  =  to_the_right_in
second  =  second
first  =  first
to_the_right_out(x1, x2)  =  to_the_right_out(x1, x2)
third  =  third
fourth  =  fourth
fifth  =  fifth
U6(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U6(x14)
U7(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U7(x16)
U8(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U8(x18)
U9(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U9(x19)
U10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U10(x19)
next_to_in(x1, x2)  =  next_to_in
next_to_out(x1, x2)  =  next_to_out(x1, x2)
U11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U11(x21)
U12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U12(x22)
U13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U13(x24)
U14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U14(x25)
U15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U15(x5, x21)
houses_in(x1)  =  houses_in(x1)
.(x1, x2)  =  .(x2)
[]  =  []
U20(x1, x2)  =  U20(x2)
domain_in(x1, x2)  =  domain_in(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
U22(x1, x2, x3, x4)  =  U22(x4)
domain_out(x1, x2)  =  domain_out
houses_out(x1)  =  houses_out
U16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U16(x5, x21)
U17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U17(x5, x17)
U18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U18(x5, x12)
U19(x1, x2, x3, x4, x5, x6, x7, x8)  =  U19(x5, x8)
zebra_out(x1, x2, x3, x4, x5, x6, x7)  =  zebra_out(x5)
U151(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U151(x5, x21)
U201(x1, x2)  =  U201(x2)
DOMAIN_IN(x1, x2)  =  DOMAIN_IN(x1, x2)
U181(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U181(x5, x12)
SELECT_IN(x1, x2, x3)  =  SELECT_IN(x2)
U221(x1, x2, x3, x4)  =  U221(x4)
EQ_IN(x1, x2)  =  EQ_IN
HOUSES_IN(x1)  =  HOUSES_IN(x1)
U121(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U121(x22)
U61(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U61(x14)
U21(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U21(x9)
U191(x1, x2, x3, x4, x5, x6, x7, x8)  =  U191(x5, x8)
NEXT_TO_IN(x1, x2)  =  NEXT_TO_IN
U171(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U171(x5, x17)
U131(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U131(x24)
TO_THE_RIGHT_IN(x1, x2)  =  TO_THE_RIGHT_IN
U51(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U51(x13)
ZEBRA_IN(x1, x2, x3, x4, x5, x6, x7)  =  ZEBRA_IN
U141(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U141(x25)
U71(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U71(x16)
U231(x1, x2, x3, x4, x5)  =  U231(x5)
U101(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U101(x19)
U41(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U41(x12)
U31(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U31(x10)
U11(x1, x2, x3, x4, x5, x6, x7, x8)  =  U11(x8)
U211(x1, x2, x3, x4)  =  U211(x2, x4)
U81(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U81(x18)
U91(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U91(x19)
U161(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U161(x5, x21)
U111(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U111(x21)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

ZEBRA_IN(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
ZEBRA_IN(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → EQ_IN(Englishman, Red)
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U21(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → EQ_IN(Spaniard, Dog)
U21(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U31(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U21(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → EQ_IN(Green, Coffee)
U31(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U41(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U31(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → EQ_IN(Ukrainian, Tea)
U41(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U51(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
U41(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → TO_THE_RIGHT_IN(Green, Ivory)
U51(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U61(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U51(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → EQ_IN(Winston, Snails)
U61(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U71(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U61(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → EQ_IN(Kool, Yellow)
U71(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U81(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U71(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → EQ_IN(Milk, third)
U81(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U91(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U81(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → EQ_IN(Norwegian, first)
U91(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U101(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
U91(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → NEXT_TO_IN(Fox, Chesterfield)
U101(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U111(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U101(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → NEXT_TO_IN(Horse, Kool)
U111(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U121(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U111(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → EQ_IN(Lucky, Juice)
U121(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U131(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U121(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → EQ_IN(Japanese, Parliament)
U131(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U141(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U131(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → NEXT_TO_IN(Norwegian, Blue)
U141(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U151(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
U141(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → HOUSES_IN(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))
HOUSES_IN(Prop) → U201(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
HOUSES_IN(Prop) → DOMAIN_IN(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))
DOMAIN_IN(.(X, Rest), Domain) → U211(X, Rest, Domain, select_in(X, Domain, NewDomain))
DOMAIN_IN(.(X, Rest), Domain) → SELECT_IN(X, Domain, NewDomain)
SELECT_IN(X, .(Y, R), .(Y, Rest)) → U231(X, Y, R, Rest, select_in(X, R, Rest))
SELECT_IN(X, .(Y, R), .(Y, Rest)) → SELECT_IN(X, R, Rest)
U211(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U221(X, Rest, Domain, domain_in(Rest, NewDomain))
U211(X, Rest, Domain, select_out(X, Domain, NewDomain)) → DOMAIN_IN(Rest, NewDomain)
U151(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U161(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U151(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → HOUSES_IN(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))
U161(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U171(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U161(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → HOUSES_IN(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))
U171(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U181(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U171(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → HOUSES_IN(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))
U181(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U191(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U181(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → HOUSES_IN(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))

The TRS R consists of the following rules:

zebra_in(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
eq_in(X, X) → eq_out(X, X)
U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
to_the_right_in(second, first) → to_the_right_out(second, first)
to_the_right_in(third, second) → to_the_right_out(third, second)
to_the_right_in(fourth, third) → to_the_right_out(fourth, third)
to_the_right_in(fifth, fourth) → to_the_right_out(fifth, fourth)
U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
next_to_in(first, second) → next_to_out(first, second)
next_to_in(second, first) → next_to_out(second, first)
next_to_in(second, third) → next_to_out(second, third)
next_to_in(third, second) → next_to_out(third, second)
next_to_in(third, fourth) → next_to_out(third, fourth)
next_to_in(fourth, third) → next_to_out(fourth, third)
next_to_in(fourth, fifth) → next_to_out(fourth, fifth)
next_to_in(fifth, fourth) → next_to_out(fifth, fourth)
U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
houses_in(Prop) → U20(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
domain_in(.(X, Rest), Domain) → U21(X, Rest, Domain, select_in(X, Domain, NewDomain))
select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))
U21(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U22(X, Rest, Domain, domain_in(Rest, NewDomain))
domain_in([], X) → domain_out([], X)
U22(X, Rest, Domain, domain_out(Rest, NewDomain)) → domain_out(.(X, Rest), Domain)
U20(Prop, domain_out(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))) → houses_out(Prop)
U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_out(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))) → zebra_out(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water)

The argument filtering Pi contains the following mapping:
zebra_in(x1, x2, x3, x4, x5, x6, x7)  =  zebra_in
U1(x1, x2, x3, x4, x5, x6, x7, x8)  =  U1(x8)
eq_in(x1, x2)  =  eq_in
eq_out(x1, x2)  =  eq_out
U2(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U2(x9)
U3(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U3(x10)
U4(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U4(x12)
U5(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U5(x13)
to_the_right_in(x1, x2)  =  to_the_right_in
second  =  second
first  =  first
to_the_right_out(x1, x2)  =  to_the_right_out(x1, x2)
third  =  third
fourth  =  fourth
fifth  =  fifth
U6(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U6(x14)
U7(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U7(x16)
U8(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U8(x18)
U9(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U9(x19)
U10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U10(x19)
next_to_in(x1, x2)  =  next_to_in
next_to_out(x1, x2)  =  next_to_out(x1, x2)
U11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U11(x21)
U12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U12(x22)
U13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U13(x24)
U14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U14(x25)
U15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U15(x5, x21)
houses_in(x1)  =  houses_in(x1)
.(x1, x2)  =  .(x2)
[]  =  []
U20(x1, x2)  =  U20(x2)
domain_in(x1, x2)  =  domain_in(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
U22(x1, x2, x3, x4)  =  U22(x4)
domain_out(x1, x2)  =  domain_out
houses_out(x1)  =  houses_out
U16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U16(x5, x21)
U17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U17(x5, x17)
U18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U18(x5, x12)
U19(x1, x2, x3, x4, x5, x6, x7, x8)  =  U19(x5, x8)
zebra_out(x1, x2, x3, x4, x5, x6, x7)  =  zebra_out(x5)
U151(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U151(x5, x21)
U201(x1, x2)  =  U201(x2)
DOMAIN_IN(x1, x2)  =  DOMAIN_IN(x1, x2)
U181(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U181(x5, x12)
SELECT_IN(x1, x2, x3)  =  SELECT_IN(x2)
U221(x1, x2, x3, x4)  =  U221(x4)
EQ_IN(x1, x2)  =  EQ_IN
HOUSES_IN(x1)  =  HOUSES_IN(x1)
U121(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U121(x22)
U61(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U61(x14)
U21(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U21(x9)
U191(x1, x2, x3, x4, x5, x6, x7, x8)  =  U191(x5, x8)
NEXT_TO_IN(x1, x2)  =  NEXT_TO_IN
U171(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U171(x5, x17)
U131(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U131(x24)
TO_THE_RIGHT_IN(x1, x2)  =  TO_THE_RIGHT_IN
U51(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U51(x13)
ZEBRA_IN(x1, x2, x3, x4, x5, x6, x7)  =  ZEBRA_IN
U141(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U141(x25)
U71(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U71(x16)
U231(x1, x2, x3, x4, x5)  =  U231(x5)
U101(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U101(x19)
U41(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U41(x12)
U31(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U31(x10)
U11(x1, x2, x3, x4, x5, x6, x7, x8)  =  U11(x8)
U211(x1, x2, x3, x4)  =  U211(x2, x4)
U81(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U81(x18)
U91(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U91(x19)
U161(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U161(x5, x21)
U111(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U111(x21)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 43 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN(X, .(Y, R), .(Y, Rest)) → SELECT_IN(X, R, Rest)

The TRS R consists of the following rules:

zebra_in(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
eq_in(X, X) → eq_out(X, X)
U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
to_the_right_in(second, first) → to_the_right_out(second, first)
to_the_right_in(third, second) → to_the_right_out(third, second)
to_the_right_in(fourth, third) → to_the_right_out(fourth, third)
to_the_right_in(fifth, fourth) → to_the_right_out(fifth, fourth)
U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
next_to_in(first, second) → next_to_out(first, second)
next_to_in(second, first) → next_to_out(second, first)
next_to_in(second, third) → next_to_out(second, third)
next_to_in(third, second) → next_to_out(third, second)
next_to_in(third, fourth) → next_to_out(third, fourth)
next_to_in(fourth, third) → next_to_out(fourth, third)
next_to_in(fourth, fifth) → next_to_out(fourth, fifth)
next_to_in(fifth, fourth) → next_to_out(fifth, fourth)
U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
houses_in(Prop) → U20(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
domain_in(.(X, Rest), Domain) → U21(X, Rest, Domain, select_in(X, Domain, NewDomain))
select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))
U21(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U22(X, Rest, Domain, domain_in(Rest, NewDomain))
domain_in([], X) → domain_out([], X)
U22(X, Rest, Domain, domain_out(Rest, NewDomain)) → domain_out(.(X, Rest), Domain)
U20(Prop, domain_out(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))) → houses_out(Prop)
U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_out(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))) → zebra_out(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water)

The argument filtering Pi contains the following mapping:
zebra_in(x1, x2, x3, x4, x5, x6, x7)  =  zebra_in
U1(x1, x2, x3, x4, x5, x6, x7, x8)  =  U1(x8)
eq_in(x1, x2)  =  eq_in
eq_out(x1, x2)  =  eq_out
U2(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U2(x9)
U3(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U3(x10)
U4(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U4(x12)
U5(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U5(x13)
to_the_right_in(x1, x2)  =  to_the_right_in
second  =  second
first  =  first
to_the_right_out(x1, x2)  =  to_the_right_out(x1, x2)
third  =  third
fourth  =  fourth
fifth  =  fifth
U6(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U6(x14)
U7(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U7(x16)
U8(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U8(x18)
U9(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U9(x19)
U10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U10(x19)
next_to_in(x1, x2)  =  next_to_in
next_to_out(x1, x2)  =  next_to_out(x1, x2)
U11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U11(x21)
U12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U12(x22)
U13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U13(x24)
U14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U14(x25)
U15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U15(x5, x21)
houses_in(x1)  =  houses_in(x1)
.(x1, x2)  =  .(x2)
[]  =  []
U20(x1, x2)  =  U20(x2)
domain_in(x1, x2)  =  domain_in(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
U22(x1, x2, x3, x4)  =  U22(x4)
domain_out(x1, x2)  =  domain_out
houses_out(x1)  =  houses_out
U16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U16(x5, x21)
U17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U17(x5, x17)
U18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U18(x5, x12)
U19(x1, x2, x3, x4, x5, x6, x7, x8)  =  U19(x5, x8)
zebra_out(x1, x2, x3, x4, x5, x6, x7)  =  zebra_out(x5)
SELECT_IN(x1, x2, x3)  =  SELECT_IN(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN(X, .(Y, R), .(Y, Rest)) → SELECT_IN(X, R, Rest)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
SELECT_IN(x1, x2, x3)  =  SELECT_IN(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SELECT_IN(.(R)) → SELECT_IN(R)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

DOMAIN_IN(.(X, Rest), Domain) → U211(X, Rest, Domain, select_in(X, Domain, NewDomain))
U211(X, Rest, Domain, select_out(X, Domain, NewDomain)) → DOMAIN_IN(Rest, NewDomain)

The TRS R consists of the following rules:

zebra_in(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water) → U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_in(Englishman, Red))
eq_in(X, X) → eq_out(X, X)
U1(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, eq_out(Englishman, Red)) → U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_in(Spaniard, Dog))
U2(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, eq_out(Spaniard, Dog)) → U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_in(Green, Coffee))
U3(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, eq_out(Green, Coffee)) → U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_in(Ukrainian, Tea))
U4(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, eq_out(Ukrainian, Tea)) → U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_in(Green, Ivory))
to_the_right_in(second, first) → to_the_right_out(second, first)
to_the_right_in(third, second) → to_the_right_out(third, second)
to_the_right_in(fourth, third) → to_the_right_out(fourth, third)
to_the_right_in(fifth, fourth) → to_the_right_out(fifth, fourth)
U5(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, to_the_right_out(Green, Ivory)) → U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_in(Winston, Snails))
U6(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, eq_out(Winston, Snails)) → U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_in(Kool, Yellow))
U7(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, eq_out(Kool, Yellow)) → U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_in(Milk, third))
U8(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, eq_out(Milk, third)) → U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_in(Norwegian, first))
U9(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, eq_out(Norwegian, first)) → U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_in(Fox, Chesterfield))
next_to_in(first, second) → next_to_out(first, second)
next_to_in(second, first) → next_to_out(second, first)
next_to_in(second, third) → next_to_out(second, third)
next_to_in(third, second) → next_to_out(third, second)
next_to_in(third, fourth) → next_to_out(third, fourth)
next_to_in(fourth, third) → next_to_out(fourth, third)
next_to_in(fourth, fifth) → next_to_out(fourth, fifth)
next_to_in(fifth, fourth) → next_to_out(fifth, fourth)
U10(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, next_to_out(Fox, Chesterfield)) → U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_in(Horse, Kool))
U11(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, next_to_out(Horse, Kool)) → U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_in(Lucky, Juice))
U12(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, eq_out(Lucky, Juice)) → U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_in(Japanese, Parliament))
U13(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, eq_out(Japanese, Parliament)) → U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_in(Norwegian, Blue))
U14(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Red, Dog, Green, Coffee, Tea, Ivory, Winston, Snails, Kool, Yellow, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, next_to_out(Norwegian, Blue)) → U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, [])))))))
houses_in(Prop) → U20(Prop, domain_in(Prop, .(first, .(second, .(third, .(fourth, .(fifth, [])))))))
domain_in(.(X, Rest), Domain) → U21(X, Rest, Domain, select_in(X, Domain, NewDomain))
select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))
U21(X, Rest, Domain, select_out(X, Domain, NewDomain)) → U22(X, Rest, Domain, domain_in(Rest, NewDomain))
domain_in([], X) → domain_out([], X)
U22(X, Rest, Domain, domain_out(Rest, NewDomain)) → domain_out(.(X, Rest), Domain)
U20(Prop, domain_out(Prop, .(first, .(second, .(third, .(fourth, .(fifth, []))))))) → houses_out(Prop)
U15(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Blue, .(Green, .(Red, .(Yellow, .(Ivory, []))))))) → U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_in(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, [])))))))
U16(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Dog, Coffee, Tea, Winston, Snails, Kool, Milk, Fox, Chesterfield, Horse, Lucky, Juice, Parliament, houses_out(.(Norwegian, .(Englishman, .(Spaniard, .(Japanese, .(Ukrainian, []))))))) → U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_in(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, [])))))))
U17(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Winston, Kool, Milk, Chesterfield, Lucky, Juice, Parliament, houses_out(.(Dog, .(Zebra, .(Fox, .(Snails, .(Horse, []))))))) → U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_in(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, [])))))))
U18(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, Coffee, Tea, Milk, Juice, houses_out(.(Parliament, .(Kool, .(Lucky, .(Chesterfield, .(Winston, []))))))) → U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_in(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, [])))))))
U19(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water, houses_out(.(Milk, .(Juice, .(Water, .(Tea, .(Coffee, []))))))) → zebra_out(Englishman, Spaniard, Japanese, Ukrainian, Norwegian, Zebra, Water)

The argument filtering Pi contains the following mapping:
zebra_in(x1, x2, x3, x4, x5, x6, x7)  =  zebra_in
U1(x1, x2, x3, x4, x5, x6, x7, x8)  =  U1(x8)
eq_in(x1, x2)  =  eq_in
eq_out(x1, x2)  =  eq_out
U2(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U2(x9)
U3(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U3(x10)
U4(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U4(x12)
U5(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)  =  U5(x13)
to_the_right_in(x1, x2)  =  to_the_right_in
second  =  second
first  =  first
to_the_right_out(x1, x2)  =  to_the_right_out(x1, x2)
third  =  third
fourth  =  fourth
fifth  =  fifth
U6(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)  =  U6(x14)
U7(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)  =  U7(x16)
U8(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)  =  U8(x18)
U9(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U9(x19)
U10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U10(x19)
next_to_in(x1, x2)  =  next_to_in
next_to_out(x1, x2)  =  next_to_out(x1, x2)
U11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U11(x21)
U12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)  =  U12(x22)
U13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24)  =  U13(x24)
U14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25)  =  U14(x25)
U15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U15(x5, x21)
houses_in(x1)  =  houses_in(x1)
.(x1, x2)  =  .(x2)
[]  =  []
U20(x1, x2)  =  U20(x2)
domain_in(x1, x2)  =  domain_in(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
U22(x1, x2, x3, x4)  =  U22(x4)
domain_out(x1, x2)  =  domain_out
houses_out(x1)  =  houses_out
U16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)  =  U16(x5, x21)
U17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)  =  U17(x5, x17)
U18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)  =  U18(x5, x12)
U19(x1, x2, x3, x4, x5, x6, x7, x8)  =  U19(x5, x8)
zebra_out(x1, x2, x3, x4, x5, x6, x7)  =  zebra_out(x5)
DOMAIN_IN(x1, x2)  =  DOMAIN_IN(x1, x2)
U211(x1, x2, x3, x4)  =  U211(x2, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

DOMAIN_IN(.(X, Rest), Domain) → U211(X, Rest, Domain, select_in(X, Domain, NewDomain))
U211(X, Rest, Domain, select_out(X, Domain, NewDomain)) → DOMAIN_IN(Rest, NewDomain)

The TRS R consists of the following rules:

select_in(X, .(Y, R), .(Y, Rest)) → U23(X, Y, R, Rest, select_in(X, R, Rest))
select_in(X, .(X, R), R) → select_out(X, .(X, R), R)
U23(X, Y, R, Rest, select_out(X, R, Rest)) → select_out(X, .(Y, R), .(Y, Rest))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
select_in(x1, x2, x3)  =  select_in(x2)
U23(x1, x2, x3, x4, x5)  =  U23(x5)
select_out(x1, x2, x3)  =  select_out(x3)
DOMAIN_IN(x1, x2)  =  DOMAIN_IN(x1, x2)
U211(x1, x2, x3, x4)  =  U211(x2, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

DOMAIN_IN(.(Rest), Domain) → U211(Rest, select_in(Domain))
U211(Rest, select_out(NewDomain)) → DOMAIN_IN(Rest, NewDomain)

The TRS R consists of the following rules:

select_in(.(R)) → U23(select_in(R))
select_in(.(R)) → select_out(R)
U23(select_out(Rest)) → select_out(.(Rest))

The set Q consists of the following terms:

select_in(x0)
U23(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: